<template>
  <div>
    <div class="top">
      <div class="left">星辰教务系统</div>
      <div class="right">
        <el-tooltip class="item" effect="dark" content="个人中心" placement="left-end">
        <el-link type="primary">
          <i class="el-icon-user" @click="Info()"></i>
        </el-link>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" content="退出登入" placement="right-end">
        <el-link type="primary" @click="loginout()">
          <span class="fontFamily hhtxtuichu"></span>
        </el-link>
        </el-tooltip>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      user:""
    };
  },
  created() {
    this.user = sessionStorage.getItem("user");
  },
  mounted() {
  },
  methods: {
    Info(){
       this.$router.push("/studentInfo");
    },
    loginout() {
      this.$confirm("确定退出吗, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          sessionStorage.clear();
          this.$router.push("/");
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "退出失败"
          });
        });
    }
  }
};
</script>

<style scoped>
.top {
  width: 100%;
  height: 40px;
  background-color: white;
  margin-bottom: 20px;
  line-height: 40px;
  display: flex;
  justify-content: space-between;
}
.top .left {
  padding-left: 20px;
}
.top .right {
  padding-right: 20px;
}
.top .right span {
  margin-left: 10px;
}
</style>



